/*
*/
$(document).ready(function(){
  var $avatar= $('#avatar_select'),
      $trigger= $('<a>'),
      $viewer= $('#avatar_view');
  var avatarSrc= $viewer.attr('src');
  $trigger.fancybox({
    width:805,
    height:490,
    content: $avatar
  });
  window.beginAvatar= function(){
    $trigger.click();
  };
  window.updateavatar= function(){
  //用于ucenter修改头像后回调
    $.fancybox.close();
    var path=  avatarSrc+'?'+Math.random() ;
    $viewer.attr('src',path );
  };
});